package demo.vo.thread;

import com.alibaba.fastjson.JSON;

/**
 * 线程统计信息
 */
public class ThreadStat {
    // 线程ID
    private int id;

    private String name;

    private int priority;
    // 线程运行总CPU时间
    private long time;

    private Boolean interrupted;
    // CPU使用率
    private double cpu;
    // 是否守护线程
    private Boolean daemon;
    // 采样间隔时间内线程的增量CPU时间，小于1ms时被取整显示为0ms。
    private double deltaTime;

    private String group;
    // 线程状态：RUNNABLE、WAITING
    private String state;


    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getPriority() {
        return priority;
    }

    public void setPriority(int priority) {
        this.priority = priority;
    }

    public long getTime() {
        return time;
    }

    public void setTime(long time) {
        this.time = time;
    }

    public Boolean getInterrupted() {
        return interrupted;
    }

    public void setInterrupted(Boolean interrupted) {
        this.interrupted = interrupted;
    }

    public double getCpu() {
        return cpu;
    }

    public void setCpu(double cpu) {
        this.cpu = cpu;
    }

    public Boolean getDaemon() {
        return daemon;
    }

    public void setDaemon(Boolean daemon) {
        this.daemon = daemon;
    }

    public double getDeltaTime() {
        return deltaTime;
    }

    public void setDeltaTime(double deltaTime) {
        this.deltaTime = deltaTime;
    }

    public String getGroup() {
        return group;
    }

    public void setGroup(String group) {
        this.group = group;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    @Override
    public String toString() {
        return JSON.toJSONString(this);
    }
}
